<template>
  <div>
    <el-form-item
      v-for="item in renderList"
      :key="item.prop"
      :prop="item.prop"
    >
      <el-input
        :prefix-icon="item.icon"
        v-model="formData[item.model]"
        :placeholder="item.placeholder"
        :maxlength="item.maxLength"
        :type="item.type"
        :show-word-limit="item.wordLimit"
        :show-password="item.showPass"
      />
    </el-form-item>
  </div>
</template>

<script>
export default {
  name: 'FormItem',
  props: {
    renderList: {
      type: Array,
      default: () => []
    },
    formData: {
      type: Object,
      default: () => {}
    }
  }
};
</script>
